package io.gitee.horizon007.webspider.provider;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

public class StringProvider implements DocumentProvider {

    private final String text;
    private final String baseUri;

    public StringProvider(String text) {
        this(text, "");
    }

    public StringProvider(String text, String baseUri) {
        this.text = text;
        this.baseUri = baseUri;
    }

    @Override
    public Document getDocument() {
        return Jsoup.parse(text, baseUri);
    }
}
